package com.feel.mall.goodsservice;

import com.feel.mall.common.bean.Goods;
import com.feel.mall.common.bean.GoodsPic;
import com.feel.mall.goodsservice.mapper.GoodsMapper;
import com.feel.mall.goodsservice.mapper.GoodsPicMapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

/**
 * @Author: 刘永钦
 * @Description:
 */
@SpringBootTest
public class MyTest01 {
    @Autowired
    private GoodsPicMapper goodsPicMapper;
    @Autowired
    private GoodsMapper goodsMapper;

    @Test
    void test01() {
        List<GoodsPic> list = goodsPicMapper.selectByGoodsId(4);
        list.forEach(System.out::println);
    }

    @Test
    void test02() {
        Goods goods = goodsMapper.selectById(1);
        System.out.println(goods);
    }

    @Test
    void test03() {
        // // Goods goods = new Goods(null, "123456", "1", "1", new BigDecimalmal("1"), new BigDecimal("1"), new BigDecimal("1"), "1", "1", 1, 1, 1, 1f, 1, null, null);
        // int insert = goodsMapper.insert(goods);
        // System.out.println("==================");
        // System.out.println(goods.getId());
    }

    @Test
    void test04() {
        // Goods goods = new Goods(506, "9999999999", "1", "1", new BigDecimal("1"), new BigDecimal("1"), new BigDecimal("1"), "1", "1", 1, 1, 1, 1f, 1, null, null);
        // int i = goodsMapper.update(goods);

    }
}
